1. Field of the Invention
The present invention relates to a programmable sequence controller with a circuit for decoding auxiliary function data generated from a numerical control device.
2. Description of the Prior Art
In a numerical control system, in addition to feed amount command data for controlling a feed amount of a table and the like, auxiliary function command data, such as M-function data for instructing a start or stop of a spindle, a tool exchange and the like, S-function data for instructing a rotational speed of the spindle and T-function data for instructing a tool to be selected, are programmed and stored in a command tape or a memory. The numerical control device successively reads out this program and generates feed command pulses to control a servo motor for a feed movement in each axis. However, the numerical control device merely generates signals in binary coded decimal code (BCD code) from auxiliary function terminals, when reading the auxiliary function command data. Accordingly, in order to control the above-mentioned auxiliary functions, a power control unit provided on a machine side receives auxiliary function command data to decode the same so as thereby to control relays or solenoids. A relay type control panel is conventionally used as the power control unit. In order to decode the auxiliary function command data in this relay type control panel, relays CRM1 to CRM80 and CRMF are provided to receive auxiliary function codes M1 to M80 and MF generated from the numerical control device NC, as shown in FIG. 1. The contacts of these relays CRM1 to CRM80 and CRMF are arranged in a tree-matrix to constitute a decoding circuit, as shown in FIG. 2. In substitution for the relay type control panel, a programmable sequence controller is adopted. An example of a programmable sequence controller is disclosed in U.S. Pat. Nos. 3,832,696; 3,996,565; 4,025,902; and 4,048,622, the disclosures of which are hereby incorporated by reference. In this controller, the decoding circuit of the tree-matrix, as shown in FIG. 2, is provided by a program, and accordingly, there is no need to provide a hardwired connection. However, since one auxiliary function code is usually constituted by 8 bits in BCD code, at least 8 commands are required for testing ON-OFF status of each bit. In addition, there are required a command for testing an MF signal and an output command for generating a predetermined auxiliary function instruction in accordance with a satisfaction of the test result. By way of example, a decoding program for M01 is shown in Table 1.
TABLE 1 ______________________________________ Memory Address Command Address Meaning ______________________________________ n+1 TNA CRMF (test under AND logic whether CRMF is ON) n+2 TFA CRM80 (test under AND logic whether CRM80 is OFF) n+3 TFA CRM40 (test under AND logic whether CRM40 is OFF) n+4 TFA CRM20 (test under AND logic whether CRM20 is OFF) n+5 TFA CRM10 (test under AND logic whether CRM10 is OFF) n+6 TFA CRM8 (test under AND logic whether CRM8 is OFF) n+7 TFA CRM4 (test under AND logic whether CRM4 is OFF) n+8 TFA CRM2 (test under AND logic whether CRM2 is OFF) n+9 TNA CRM1 (test under AND logic whether CRM1 is ON) n+10 YON CRO1 (make CRO1 ON if test result is satisfied) ______________________________________
Accordingly, at least 10 words are required for a decoding program of one auxiliary function, as shown in TABLE 1. When the number of functions to be decoded is increased, a capacity of decoding programs is increased in a memory. If an object to be sequence-controlled is complicated, the number of the memory has to be increased and it takes considerable time to prepare a decoding program, with the result of a heavy burden to a programmer.